<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            padding: 20px;
        }
    </style>
</head>

<body style="width: 2000px;height: 2000px;">
    <script>
        // 获取页面的宽高
        console.log(document.documentElement.scrollWidth)
        console.log(document.documentElement.scrollHeight)
        console.log(document.body.offsetWidth)
        console.log(document.body.offsetHeight)

    </script>
</body>

</html>